

module.exports = {
    /**
     * @description 给路由加前缀
     * @returns viod 0
     */
    addRoutePrefix:()=>{
        return function (req, res, next) {
            req.baseUrl = `${prefix}${req.baseUrl || ''}`;
            // 如果有 query 参数，则保留原有参数
            req.url = `${req.baseUrl}${req.url.includes('?') ? req.url.split('?')[1] : ''}`;
            next();
          };
    }
}

